package com.example.stock.entity.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.stock.entity.eo.AmountVolEo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author zhuchunfeng
 * @date 2019/8/8 16:34
 */
@Mapper
public interface AmountVolMapper extends BaseMapper<AmountVolEo> {

    @Select("SELECT ts_code FROM amount_vol where trade_time >= #{startTime} and trade_time <= #{endTime}  GROUP BY ts_code ORDER BY SUM(amount) desc limit 5")
    List<String> listTopTen(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
